// #ifdef H5
import wxsdk from '@/wlkutils/wechat/sdk';
import { router } from '@/wlkutils/router';
// #endif
class Platform {
    static get() {
        let platform = '';
        // #ifdef H5
        wxsdk.map.isWechat() ? (platform = 'wxOfficialAccount') : (platform = 'H5');
        // #endif
        // #ifdef MP-WEIXIN
        platform = 'wxMiniProgram';
        // #endif
        return platform;
    }

    static device() {
        return uni.getSystemInfoSync().platform;
    }
// #ifdef H5
    static host() {
        let host = location.origin + router.$route.options.base;
        if (router.$route.options.mode === 'hash') {
            host += '#/';
        }
        return host;
    }
// #endif

}

export default Platform;
